import request from '@/utils/request'

// 查询异常填报列表
export function listRecord(query) {
  return request({
    url: '/mes/exception/confirm/list',
    method: 'get',
    params: query
  })
}

// 查询异常填报详细
export function getRecord(id) {
  return request({
    url: '/system/record/' + id,
    method: 'get'
  })
}

// 新增异常填报
export function addRecord(data) {
  return request({
    url: '/mes/exception/record/add',
    method: 'post',
    data: data
  })
}

// 修改异常填报
export function updateRecord(data) {
  return request({
    url: '/mes/exception/record/edit',
    method: 'post',
    data: data
  })
}

// 删除异常填报
export function delRecord(id) {
  return request({
    url: '/system/record/' + id,
    method: 'delete'
  })
}

// 异常分类
export function getTreeList(query) {
  return request({
    url: '/mes/type/getTreeList',
    method: 'get',
    params: query
  })
}

// 获取sn信息
export function getWorkorderBySnCode(data) {
  return request({
    url: '/mes/pro/workorder/getWorkorderBySnCode',
    method: 'post',
    data: data
  })
}

export function confirmSubmit(query) {
  return request({
    url: '/mes/exception/confirm/confirmSubmit',
    method: 'get',
    params: query
  })
}

